package chapter04.example17;
class Animal{
    public void shout(){
        System.out.println("喵...");
    }
}
class Dog extends Animal {
    public void shout(){
        System.out.println("汪...");
    }
    public void est(){
        System.out.println("吃骨头...");
    }
}
public class example17 {
    public static void main(String[] args){
        Animal a1 = new Dog();
        System.out.println("instanceof判断a1是否是来自动物类" +(a1 instanceof Animal));
        System.out.println("instanceof判断a1是否是来自狗类" +(a1 instanceof Dog));
        Animal a2 = new Animal();
        System.out.println("instanceof判断a2是否是来自动物类" +(a2 instanceof Animal));
        System.out.println("instanceof判断a2是否是来自狗类" +(a2 instanceof Dog));

    }
}
